<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="cn.itcast.User"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>使用sun el函数</title>
  </head>
  
  <body>
    
    
    ${fn:toLowerCase("AAAA") }
    
    
    <% 
    	List list = Arrays.asList("1","2","3");
    	request.setAttribute("list",list);
    %>
    ${fn:length(list) }
    ${fn:length("aaaaa") }
    
    
    ${fn:split("aaa.bbb.ccc",".")[1] }
    
    <!-- 先以,分割，然后以.拼接 -->
    ${fn:join(fn:split("www,flx,com",","),".") }
    
    
     <br/><br/>---------------使用el函数回显数据（重要！！！）---------------------------<br/>
    
     <% 
    	User user = new User();
    	String likes[] = {"sing","dance"};
    	user.setLikes(likes);
    	
    	//数据回显
    	request.setAttribute("user",user);
    %>
 <!--${fn:contains(fn:join(user.likes,","),"sing")?'checked':'' }  
  join 先把数组转换成字符串  然后调用contains来判断是否包含
   -->
    <input type="checkbox" name="like" vlaue="sing" ${fn:contains(fn:join(user.likes,","),"sing")?'checked':'' }>唱歌
     <input type="checkbox" name="like" value="dance"  ${fn:contains(fn:join(user.likes,","),"dance")?'checked':'' }>跳舞
      <input type="checkbox" name="like" value="basketball"  ${fn:contains(fn:join(user.likes,","),"basketball")?'checked':'' }>蓝球
       <input type="checkbox" name="like" value="football"  ${fn:contains(fn:join(user.likes,","),"football")?'checked':'' }>足球
    
    
    ${fn:escapeXml("<a href=''>点点</a>") }
    
  </body>
</html>
